Skip to content

Feature: Restart as admin & use New-NetNeighbor / Remove-NetNeighbor#3403

Merged
mergify[bot] merged 12 commits intomainfrom
feature/neighbor-table
May 3, 2026
Merged

Feature: Restart as admin & use New-NetNeighbor / Remove-NetNeighbor#3403
mergify[bot] merged 12 commits intomainfrom
feature/neighbor-table

Conversation

@BornToBeRoot
Copy link
Copy Markdown
Owner

@BornToBeRoot BornToBeRoot commented Apr 29, 2026

Changes proposed in this pull request

This pull request implements a comprehensive rename and refactor of the application's "ARP Table" feature, transitioning it to "Neighbor Table" to better reflect support for both IPv4 ARP and IPv6 NDP. It updates code, resources, and documentation to use the new terminology throughout, while maintaining backward compatibility for legacy settings. Additionally, it introduces localization support for neighbor states and improves resource naming consistency.

Major terminology and feature refactor:

  • Renamed the ARPTable application and related documentation identifiers to NeighborTable, updating all code references, resource strings, and documentation links accordingly. The obsolete ARPTable enum value is retained (marked [Obsolete]) for backward compatibility with old settings files. [1] [2] [3] [4] [5] [6] [7] [8]

  • Updated resource files and localization to replace "ARP Table" with "Neighbor Table", and added new localized strings for neighbor states and related messages. [1] [2]

Localization and converter enhancements:

  • Added a new NeighborStateToStringConverter to convert NeighborState enum values to localized strings, and registered a new NeighborState resource identifier for translation. [1] [2]

Resource and naming consistency improvements:

  • Renamed the resource key and string for group/domain from GroupDomainName to GroupDomain for clarity and consistency. [1] [2]

Documentation and project structure:

  • Added a reference in AGENTS.md to the root project guidelines and conventions.

Versioning:

  • Updated assembly version numbers to 2026.5.3.0.

Related issue(s)

To-Do

Contributing

By submitting this pull request, I confirm the following:

Copilot AI review requested due to automatic review settings April 29, 2026 22:07
@github-actions github-actions Bot added this to the next-release milestone Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ARP Table feature to better align with the “admin-gated modifications” UX pattern used elsewhere (e.g., Firewall), and moves ARP write operations into an in-process PowerShell runspace with a shared lock.

Changes:

  • Add admin-only gating for ARP table modification commands, including a “Restart as admin” command and a read-only banner when not elevated.
  • Refactor ARP modification operations to use a shared PowerShell Runspace and SemaphoreSlim for serialized execution; remove the legacy UAC-cancel event flow.
  • Add a new localized string for the ARP admin read-only message; remove an unused using directive.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Source/NETworkManager/Views/FirewallView.xaml.cs Removes an unused System.Windows.Input using.
Source/NETworkManager/Views/ARPTableView.xaml Adds a non-admin banner and “Restart as admin” button; wires visibility to ConfigurationManager.Current.IsAdmin.
Source/NETworkManager/ViewModels/ARPTableViewModel.cs Introduces IsModifying, gates modify commands behind admin + in-flight flags, and adds RestartAsAdminCommand.
Source/NETworkManager.Models/Network/ARP.cs Adds shared PowerShell runspace + lock; converts write ops to static async methods executed in-process.
Source/NETworkManager.Localization/Resources/Strings.resx Adds ARPTableAdminMessage string.
Source/NETworkManager.Localization/Resources/Strings.Designer.cs Adds the strongly-typed accessor for ARPTableAdminMessage.
Files not reviewed (1)
  • Source/NETworkManager.Localization/Resources/Strings.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Source/NETworkManager/ViewModels/NeighborTableViewModel.cs
Comment thread Source/NETworkManager.Models/Network/ARP.cs Outdated
Comment thread Source/NETworkManager.Models/Network/ARP.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 52 changed files in this pull request and generated 7 comments.

Files not reviewed (1)
  • Source/NETworkManager.Localization/Resources/Strings.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

Source/NETworkManager/ViewModels/NeighborTableViewModel.cs:374

  • AddEntryAction sets IsModifying=true and then awaits GetInterfacesAsync / shows the child window without a surrounding try/finally. If GetInterfacesAsync or ShowChildWindowAsync throws, IsModifying will remain true and the view will stay stuck with modify/refresh commands disabled. Wrap this method body in try/catch/finally (and surface an error message) so IsModifying is always reset on failure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Source/NETworkManager.Models/Network/NeighborTable.cs Outdated
Comment thread Source/NETworkManager.Models/Export/ExportManager.NeighborInfo.cs Outdated
Comment thread Website/docs/changelog/next-release.md Outdated
Comment thread Website/docs/application/neighbor-table.md Outdated
Comment thread Source/AGENTS.md
Comment thread Source/NETworkManager.Models/Network/NeighborTable.cs Outdated
Comment thread Source/NETworkManager.Models/Network/NeighborTable.cs
@BornToBeRoot BornToBeRoot requested a review from Copilot May 3, 2026 20:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 42 out of 52 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • Source/NETworkManager.Localization/Resources/Strings.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

Source/NETworkManager/ViewModels/NeighborTableViewModel.cs:336

  • AddEntryAction() sets IsModifying = true before awaiting NeighborTable.GetInterfacesAsync(), but there’s no try/finally around that await. If GetInterfacesAsync() throws (e.g., NetworkInterface APIs fail), IsModifying will remain true and permanently disable refresh/modify commands for the view. Consider moving IsModifying = true to after the interface list is loaded, or wrapping the whole method in try/catch/finally that always resets IsModifying on failure (and shows an error message).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +78 to +85
/// <summary>
/// Ensures that only one PowerShell pipeline runs on <see cref="SharedRunspace"/> at a time.
/// </summary>
private static readonly SemaphoreSlim Lock = new(1, 1);

/// <summary>Protects reads and writes to <see cref="_interfaceAliasCache"/> and <see cref="_interfaceAliasCacheExpiry"/>.</summary>
private static readonly Lock InterfaceAliasCacheLock = new();

@mergify mergify Bot merged commit 3e80653 into main May 3, 2026
5 checks passed
@mergify mergify Bot deleted the feature/neighbor-table branch May 3, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor ARP Table → Neighbor Table (IPv4 + IPv6)

2 participants